#include "Comm.h"

int main()
{
    int fd = open(PATH, O_WRONLY);
    if (fd < 0)
    {
        cout << "open error" << endl;
        return 1;
    }
    cout << "open sucessful" << endl;
    
    while(1)
    {
        string buffer;
        getline(cin, buffer);
        ssize_t n = write(fd, buffer.c_str(), buffer.size());
        if(n < 0)
        {
            cout << "write error" << endl;
            break;
        }
    }
    close(fd);
    return 0;
}